//for main menu
		var timeout         = 500;
		var closetimer		= 0;
		var ddmenuitem      = 0;
		
		/*
		function jsddm_open()
		{	jsddm_canceltimer();
			jsddm_close();
			ddmenuitem = $(this).find('ul').eq(0).css('visibility', 'visible');}
		
		function jsddm_close()
		{	if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}
		
		function jsddm_timer()
		{	closetimer = window.setTimeout(jsddm_close, timeout);}
		
		function jsddm_canceltimer()
		{	if(closetimer)
			{	window.clearTimeout(closetimer);
				closetimer = null;}}
		
		$(document).ready(function()
		{	$('#jsddm > li').bind('mouseover', jsddm_open);
			$('#jsddm > li').bind('mouseout',  jsddm_timer);});
		
		document.onclick = jsddm_close;
		//end for main menu
		*/
		//for admin menu
		// open hidden layer
		function mopen(id)
		{	
			// cancel close timer
			mcancelclosetime();
			
			if((navigator.platform.indexOf("iPhone") != -1) || (navigator.platform.indexOf("iPad") != -1))
			{
				// close old layer
				if(ddmenuitem && ddmenuitem != document.getElementById(id)) ddmenuitem.style.visibility = 'hidden';
				
				// get new layer and show it
				ddmenuitem = document.getElementById(id);
				if(ddmenuitem.style.visibility=='hidden')
					ddmenuitem.style.visibility = 'visible';
				else
					ddmenuitem.style.visibility = 'hidden';
			}
			else
			{
				// close old layer
				if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
			
				// get new layer and show it
				ddmenuitem = document.getElementById(id);
				ddmenuitem.style.visibility = 'visible';
				//document.getElementById('sddm').style.position='fixed';
			}
			
			
		
		}
		// close showed layer
		function mclose()
		{
			if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
		}
		
		// go close timer
		function mclosetime()
		{
			closetimer = window.setTimeout(mclose, timeout);
		}
		
		// cancel close timer
		function mcancelclosetime()
		{
			if(closetimer)
			{
				window.clearTimeout(closetimer);
				closetimer = null;
			}
		}
		
		// close layer when click-out
		//document.onclick = mclose; 

		//end for main menu
		
		function toggleMenu(currMenu){
		 thisMenu = document.getElementById(currMenu);
		 if (thisMenu){
	
			for(var i = 1; i<=2; i++) {
				document.getElementById('left_menu0'+ i).style.display = 'none';
			}
	
			if (thisMenu.style.display != 'block') {
				thisMenu.style.display = 'block'
			}
		 }
	
		}
		
		function toggleSubMenu(currSubMenu){
		 thisSubMenu = document.getElementById(currSubMenu);
		 if (thisSubMenu){
	
			for(var i = 1; i<=2; i++) {
				document.getElementById('left_sub_menu0'+ i).style.display = 'none';
			}
	
			if (thisSubMenu.style.display != 'block') {
				thisSubMenu.style.display = 'block'
			}
		 }
	
		}
		
		